package com.gupaoedu.vip.pattern.singleton.lazy;

/**
 * Created by Administrator on 2018/3/18.
 */
public class LazyThree {

    public static volatile LazyThree lazyThree = null;

    /**
     * 双重检查，保证了线程安全
     * @return
     */
    public static LazyThree getInstance(){
        if(null == lazyThree){
            synchronized (LazyThree.class){
                if(null == lazyThree){
                    lazyThree = new LazyThree();
                }
            }
        }

        return lazyThree;
    }
}
